package com.glsc.ngateway.common.api.flowable.dto.task.formData.cmdb;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.glsc.ngateway.common.api.flowable.dto.FlowFormCPUOutDetailDto;
import com.glsc.ngateway.common.api.flowable.dto.FlowFormDiskOutDetailDto;
import com.glsc.ngateway.common.api.flowable.dto.FlowFormMemoryOutDetailDto;
import com.glsc.ngateway.common.api.flowable.dto.FlowFormPartOutDetailDto;
import com.glsc.ngateway.common.api.flowable.dto.task.formData.AbstractTaskFormDataDto;
import com.glsc.ngateway.common.api.flowable.dto.task.formData.cmdb.domainDto.FlowFormPartOutDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.util.List;
import java.util.Objects;

/**
 * 配件规格新增/修改流程外层数据dto
 * @author zhengyr
 */
@ToString(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode(callSuper=true)
public class PartOutTaskFormDto extends AbstractTaskFormDataDto<FlowFormPartOutDto> {

    @ApiModelProperty(value = "子表-cpu出库")
    List<FlowFormCPUOutDetailDto> cpuOutDataList;
    @ApiModelProperty(value = "子表-内存出库")
    List<FlowFormMemoryOutDetailDto> memoryOutDataList;
    @ApiModelProperty(value = "子表-硬盘出库")
    List<FlowFormDiskOutDetailDto> diskOutDataList;
    @ApiModelProperty(value = "子表-其他配件出库")
    List<FlowFormPartOutDetailDto> partOutDataList;

    @Override
    public String getSystemAdminAccount() {
        return this.getFormMainData().getSystemAdminAccount();
    }

    @Override
    public String getProcessTitle() {
        return this.getFormMainData().getProcessTitle();
    }

    @Override
    public void setProcessId(String processId) {
        if(Objects.nonNull(this.getFormMainData())) {
            this.getFormMainData().setProcessId(processId);
        }
    }

    @Override
    public String getProcessId() {
        return this.getFormMainData().getProcessId();
    }

}
